let fs = require("fs");
let user = { username: "admin1", password: "12345" };
let fd = fs.readFileSync(__dirname + "/persons.json", "utf8");
let arr = JSON.parse(fd.toString())

let username = arr.find((item) => {
    return item.username == user.username && item.password == user.password
})

if (username) {
    console.log("登录成功")
} else {
    console.log("用户名和密码错误")
}